package cn.wolfcode.trip.base.mapper;

import cn.wolfcode.trip.base.domain.User;
import cn.wolfcode.trip.base.query.QueryObject;
import cn.wolfcode.trip.base.query.UserQuery;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface UserMapper {

    int deleteByPrimaryKey(Long id);

    int insert(User record);

    User selectByPrimaryKey(Long id);

    List<User> selectAll();

    int updateByPrimaryKey(User record);

    User selectByEmailAndPassword(@Param("email") String email, @Param("password") String password);

    List<?> selectForList(QueryObject qo);

    int selectFansByCount(Long id);

    int selectFollowByCount(Long id);

    List selectFollowById(QueryObject qo);

    List selectFansById(QueryObject qo);

    int checkFollowAndFans(UserQuery qo);

    void deleteUserByFans(UserQuery qo);

    void insertUserByFans(UserQuery qo);

    void updateBalance(User user);

    void updateMoney(User user);

    // 购买商品扣款
    void chargeForOrder(User user);

    void consumptionMoney(@Param("id") Long id, @Param("money") Double money);
}